{% extends 'admin/admin.html' %}
{% import "ui/admin_page.html" as pg %}
{% block css %}
    <style>
        *{
            font-family:"Microsoft YaHei";
        }
        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
            vertical-align:middle;
            text-align:center;
        }

    </style>
{% endblock %}
{% block content %}
  <!--内容-->
        <section class="content-header">
            <h1>微电影管理系统</h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 评论管理</a></li>
                <li class="active">评论列表</li>
            </ol>
        </section>
        <section class="content" id="showcontent">
            <div class="row">
                <div class="col-md-12">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">评论列表</h3>
                            <div class="box-tools">
                                <div class="input-group input-group-sm" style="width: 150px;">
                                    <input type="text" name="table_search" class="form-control pull-right"
                                           placeholder="请输入关键字...">

                                    <div class="input-group-btn">
                                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="box-body box-comments">
                            {% for msg in get_flashed_messages(category_filter=["ok"]) %}
                                <div class="alert alert-success alert-dismissible">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
                                    </button>
                                    <h4><i class="icon fa fa-check"></i> 操作成功</h4>
                                    {{ msg }}
                                </div>
                            {% endfor %}
                            {% for v in page_data.items %}
                            <div class="box-comment">
                                {% if v.face %}
                                    <img alt="50x50"
                                         src="{{ url_for('static',filename='uploads/users/'+v.user.face) }}"
                                         class="img-circle img-sm"
                                         style="border:1px solid #abcdef;width:50px;">
                                {% else %}
                                    <img alt="50x50" data-src="holder.js/50x50" class="img-circle img-sm"
                                         style="border:1px solid #abcdef;width:50px;">
                                {% endif %}
                                <div class="comment-text">
                                    <span class="username">
                                        {{ v.user.name }}
                                        <span class="text-muted pull-right">
                                            <i class="fa fa-calendar" aria-hidden="true"></i>
                                            &nbsp;
                                            {{ v.addtime }}
                                        </span>
                                    </span>
                                    关于电影<a>《{{ v.movie.title }}》</a>的评论：{{ v.content|safe }}
                                    <br><a href="{{ url_for('admin.comment_del',id=v.id,  fp=page_data.page) }}"
                                           class="label label-danger pull-right">删除</a>
                                </div>
                            </div>
                            {% endfor %}
                        </div>
                        <div class="box-footer clearfix">
                            {#                            <ul class="pagination pagination-sm no-margin pull-right">#}
                            {#                                <li><a href="#">首页</a></li>#}
                            {#                                <li><a href="#">上一页</a></li>#}
                            {#                                <li><a href="#">1</a></li>#}
                            {#                                <li><a href="#">2</a></li>#}
                            {#                                <li><a href="#">3</a></li>#}
                            {#                                <li><a href="#">下一页</a></li>#}
                            {#                                <li><a href="#">尾页</a></li>#}
                            {#                            </ul>#}
                            {{ pg.page(page_data,'admin.comment_list') }}
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--内容-->
{% endblock %}

{% block js %}
    <script>
    $(document).ready(function(){
        $("#g-6").addClass("active");
        $("#g-6-1").addClass("active");
    });
</script>
{% endblock %}